﻿using System;
using System.IO;

namespace DaveSexton.Labs.Tests.Category1.Console
{
	public sealed class Storage2Lab : BaseConsoleLab
	{
		protected override void Main()
		{
			var file = Path.Combine(StorageDirectory, StorageLab.FileName);

			TraceLine(file);
			TraceLine();

			if (Storage.FileExists(file))
			{
				TraceLine("File exists.");
			}
			else
			{
				Storage.CreateFile(file).Dispose();

				TraceLine("File created.");
			}

			if (UserInputKey("Delete (Y/N)? ").Key == ConsoleKey.Y)
			{
				Storage.DeleteFile(file);

				TraceLine("File deleted.");
			}
		}
	}
}